/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package DBLayer;

import DBLayer.Interfaces.IContainer;
import ModelLayer.SalesLine;
import java.util.ArrayList;

/**
 *
 * @author Evil
 */
public class DBSalesLine extends DatabaseAccess implements IContainer<SalesLine>
{

    public DBSalesLine()
    {
        super();
    }
    
    public SalesLine getObject(int ID)
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public ArrayList<SalesLine> getObjects()
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean SaveObject(SalesLine object)
    {
        int affectedRows = 0;

        String sql = String.format("INSERT INTO SalesLine Values (%1$s, %2$s, %3$s)",
                object.getOrder().getSalesOrderID(),
                object.getProduct().getProductID(),
                object.getQuantity());
        affectedRows = ExecuteNoResultQuery(sql);
        return affectedRows > 0;
    }

    public boolean DeleteObject(SalesLine object)
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean UpdateObject(SalesLine object)
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
